
package com.feib.soeasy.action;

import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.StringReader;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;

import net.sourceforge.stripes.action.DefaultHandler;
import net.sourceforge.stripes.action.DontBind;
import net.sourceforge.stripes.action.ForwardResolution;
import net.sourceforge.stripes.action.Resolution;
import net.sourceforge.stripes.action.StreamingResolution;
import net.sourceforge.stripes.integration.spring.SpringBean;
import net.sourceforge.stripes.validation.DateTypeConverter;
import net.sourceforge.stripes.validation.LocalizableError;
import net.sourceforge.stripes.validation.SimpleError;
import net.sourceforge.stripes.validation.Validate;
import net.sourceforge.stripes.validation.ValidationErrors;

import com.feib.soeasy.model.Group;
import com.feib.soeasy.model.Payment;
import com.feib.soeasy.pagination.PaginatedList;
import com.feib.soeasy.service.GroupService;
import com.feib.soeasy.service.Soez5006Service;
import com.feib.soeasy.util.UserUtil;


/**
 * @title (#)Soez5006ActionBean.java<br>
 * @description <br>
 * @author Jimmy Liu<br>
 * @version 1.0.0 2010/11/25
 * @copyright Far Eastern International Bank Copyright (c) 2010<br>
 * @2011/3/19 create by Jimmy Liu<br>
 */
public class Soez5006ActionBean extends BaseActionBean {


    private static final String DEFAULT_JSP = "/WEB-INF/views/soez5006/soez5006.jsp";
    
    /**
     * 業者代號查詢畫面
     */
    private static final String AJAX_QUERY_GROUP_JSP = "/WEB-INF/views/soez5006/groupPopUpList.jsp";

    private static final String AJAX_LIST_BY_GROUP = "/WEB-INF/views/soez5006/soez5006ListByGroup.jsp";
    private static final String AJAX_LIST_DETAIL = "/WEB-INF/views/soez5006/soez5006DetailList.jsp";
    private static final String AJAX_LIST_DETAILBY_GROUP="/WEB-INF/views/soez5006/soez5006ViewList.jsp";   
    private Payment qryPayment;
    
    /**
     * 查詢條件
     * 資料期間基礎：1: 銷帳日期  2:實際繳款日。
     */
    private Integer qryDateType;
    
    /**
     * 查詢條件
     * 資料期間起
     */
    @Validate( converter=DateTypeConverter.class)
    private Date qryDateFrom;

    /**
     * 查詢條件
     * 資料期間迄
     */
    @Validate( converter=DateTypeConverter.class)
    private Date qryDateTo;
    
    /**
     * 查詢條件
     * 資料期間起
     */
    @Validate( converter=DateTypeConverter.class)
    private Date qryDateFromD;

    /**
     * 查詢條件
     * 資料期間迄
     */
    @Validate( converter=DateTypeConverter.class)
    private Date qryDateToD;
    
    /**
     * 查詢條件
     * 資料期間起
     */
    @Validate( converter=DateTypeConverter.class)
    private Date qryDateFromE;

    /**
     * 查詢條件
     * 資料期間迄
     */
    @Validate( converter=DateTypeConverter.class)
    private Date qryDateToE;
    
    /**
     * 查詢條件
     * 資料期間起
     */
    @Validate( converter=DateTypeConverter.class)
    private Date qryDateFromF;

    /**
     * 查詢條件
     * 資料期間迄
     */
    @Validate( converter=DateTypeConverter.class)
    private Date qryDateToF;
    
    /**
     * 查詢條件
     * 資料期間起
     */
    @Validate( converter=DateTypeConverter.class)
    private Date qryDateFromG;

    /**
     * 查詢條件
     * 資料期間迄
     */
    @Validate( converter=DateTypeConverter.class)
    private Date qryDateToG;
    
    /**
     * 查詢條件
     * 資料期間起
     */
    @Validate( converter=DateTypeConverter.class)
    private Date qryDateFromH;

    /**
     * 查詢條件
     * 資料期間迄
     */
    @Validate( converter=DateTypeConverter.class)
    private Date qryDateToH;
    
    
	/**
	 * 查詢條件
	 * 資料期間起
	 */
	@Validate( converter=DateTypeConverter.class)
	private Date qryDateFromAll;

	/**
	 * 查詢條件
	 * 資料期間迄
	 */
	@Validate( converter=DateTypeConverter.class)
	private Date qryDateToAll;

    
    /**
     * 統計表查詢結果
     */
    private PaginatedList<Payment> queryResult;
    
    /**
     * 以業者查詢結果
     */
    private List resultByGroup;

    
    /**
     * 查詢條件
     * 帳單業者
     */
    private Group qryGroup;
    
    
    private String queryChannel;
    
    private String queryCommissionCode;
    
    private List resultChannelCommissions;
    
    private String channelD;
    private String channelE;
    private String channelF;
    private String channelG;
    private String channelH;
    
   /** 區分需要觀察的明細類型,以便調整jsp form需要帶入的條件匯出跟查詢
	 *detailType =1.單通路單代碼 ex: 7-11  61D 
	 *detailType=2.單通路全代碼 ex: 7-11  全部代碼
	 *detailType=3.全通路全代碼 (畫面上的超商／郵局合計)ex: 7-11  okcvs
	 */
	private String detailType;

	
    
    /**
     * 帳單業者查詢結果
     */
    private PaginatedList<Group> queryGroupResult;
    
    @SpringBean("soez5006Service")
    private Soez5006Service soez5006Service;
    
    @SpringBean("groupService")
    private GroupService groupService;
    
    @DontBind
    @DefaultHandler
    public Resolution doDefault()
    {
        logger.debug("Enter doDefault mehtod.");
        try {
            Calendar cal = Calendar.getInstance();
            cal.add(Calendar.DATE, -1);
            qryDateTo = cal.getTime();
            //cal.add(Calendar.MONTH, -1);
            qryDateFrom = cal.getTime();
            
            qryDateToD = cal.getTime();
            //cal.add(Calendar.MONTH, -1);
            qryDateFromD = cal.getTime();
            
            qryDateToE = cal.getTime();
            //cal.add(Calendar.MONTH, -1);
            qryDateFromE = cal.getTime();
            
            qryDateToF = cal.getTime();
            //cal.add(Calendar.MONTH, -1);
            qryDateFromF = cal.getTime();
            
            qryDateToG = cal.getTime();
            //cal.add(Calendar.MONTH, -1);
            qryDateFromG = cal.getTime();
            
            qryDateToH = cal.getTime();
            //cal.add(Calendar.MONTH, -1);
            qryDateFromH = cal.getTime();
            
        	/* 全部勾選  */
			qryDateToAll = cal.getTime();
			qryDateFromAll = cal.getTime();

        }
        catch (Exception e) {
        }
        return new ForwardResolution(DEFAULT_JSP); 
    }
    
    /**
     * TODO 改超商查詢 要群組 要調速度
     * @return
     */
    public Resolution doAjaxQuery()
    {
        logger.debug("Enter doAjaxQuery mehtod.");
        try {
            if (null == qryDateType || 2 != qryDateType.intValue())
                qryDateType = new Integer(1);
            
            if (null == this.qryPayment)
                this.qryPayment = new Payment();

            //如果不是銀行端，則查詢條件要加入帳單業者限制
            if (!UserUtil.isBankGroup())
            {
                this.qryPayment.setGroup(UserUtil.getUserGroup());
            }
            else
            {
                if (null != this.qryPayment.getGroup())
                    this.qryPayment.setGroup(this.groupService.findByExactGroupNo(this.qryPayment.getGroup().getGroupNo()));
            }
            
           // queryResult = this.soez5006Service.queryForStatisticsList(this.qryPayment.getGroup(), this.qryDateType, this.qryDateFrom, this.qryDateTo);
            //this.soez5006Service.queryStaticsByChainstoreData("D", qryDateFrom, qryDateTo);
            String[] channels = {
	        		channelD,channelE,channelF ,channelG, channelH};
            
            Date [] qryDateFroms = 
            {
            		qryDateFromD,qryDateFromE,qryDateFromF,qryDateFromG,qryDateFromH
            };
            
            Date[] qryDateTos =
            {
            		qryDateToD,qryDateToE,qryDateToF,qryDateToG,qryDateToH
            };
            
            String message="";
            //如果不是銀行端，則查詢條件要加入帳單業者限制
            if (!UserUtil.isBankGroup())
            {
            	    message = this.soez5006Service.doExportStatisticsHtml(qryPayment.getGroup(),  channels, qryDateFroms, qryDateTos);
                       }
            else
            {
            	    message = this.soez5006Service.doExportStatisticsHtml(null,  channels, qryDateFroms, qryDateTos);
            }
            
            
             
            StreamingResolution resolution = new StreamingResolution("text/html", new StringReader(message.toString()));
            resolution.setCharacterEncoding("UTF-8");
            return resolution;
            
            
        }
        catch (Exception e) {
            logger.error("超商郵局代收統計表(月)錯誤(Soez5006ActionBean.doAjaxQuery): {}",e);
        
            // 轉換錯誤訊息
            ValidationErrors errors = new ValidationErrors();
            errors.addGlobalError(new LocalizableError("doAjaxQuery.exception") );
            getContext().setValidationErrors(errors);
            // 回傳 錯誤 HTML fragments
            return super.errorsToHtmlStreams(errors);
        
        }
       
    }
    
    
    //2011.12 by Leo
    public Resolution doAjaxQueryByGroup()
    {
    	logger.debug("Enter doAjaxQueryByGroup mehtod.");
        try {
	    	if (null == this.qryPayment)
	            this.qryPayment = new Payment();
	    	
	    	//如果不是銀行端，則查詢條件要加入帳單業者限制
	        if (!UserUtil.isBankGroup())
	        {
	            this.qryPayment.setGroup(UserUtil.getUserGroup());
	        }
	        else
	        {
	            if (null != this.qryPayment.getGroup())
	                this.qryPayment.setGroup(this.groupService.findByExactGroupNo(this.qryPayment.getGroup().getGroupNo()));
	        }
	        
	        this.resultByGroup = soez5006Service.queryStatisticsByGroup(qryPayment.getGroup(), qryDateFrom, qryDateTo);
        }
        catch (Exception e) {
            logger.error("超商郵局代收統計查詢錯誤(Soez5006ActionBean.doAjaxQueryByGroup): {}",e);
        
            // 轉換錯誤訊息
            ValidationErrors errors = new ValidationErrors();
            errors.addGlobalError(new LocalizableError("doAjaxQueryByGroup.exception") );
            getContext().setValidationErrors(errors);
            // 回傳 錯誤 HTML fragments
            return super.errorsToHtmlStreams(errors);
        
        }
        return new ForwardResolution(AJAX_LIST_BY_GROUP); 
    }
    
    //2011.12 by Leo
    /**
     * 明細放大鏡
     */
    public Resolution doAjaxQueryCommissionCode()
    {
    	logger.debug("Enter doAjaxQueryCommissionCode mehtod.");
       
    	if (null == this.qryPayment)
            this.qryPayment = new Payment();
    	Group group=new Group();
    	//如果不是銀行端，則查詢條件要加入帳單業者限制
        if (!UserUtil.isBankGroup())
        {
        	group=UserUtil.getUserGroup();
            this.qryPayment.setGroup(group);
        }
        else
        {
            if (null != this.qryPayment.getGroup())
                this.qryPayment.setGroup(this.groupService.findByExactGroupNo(this.qryPayment.getGroup().getGroupNo()));
        }
        PaginatedList<Map<String,Object>> query = new PaginatedList<Map<String,Object>>();
        
        if (null != queryResult){
        	query.setPageSize(queryResult.getPageSize());
        	query.setPageNumber(queryResult.getPageNumber());
        }
       
    	try {
        	/* TODO */
    		///resultChannelCommissions = soez5006Service.queryPaymentByChannelCommission(group, queryChannel, queryCommissionCode, qryDateFrom, qryDateTo);
    		queryResult=soez5006Service.queryGroupFeedbackLogByChannelCommission(group, queryChannel, queryCommissionCode, qryDateFrom, qryDateTo, query);
    	}
        catch (Exception e) {
            logger.error("超商郵局代收統計查詢錯誤(Soez5006ActionBean.doAjaxQueryCommissionCode): {}",e);
        
            // 轉換錯誤訊息
            ValidationErrors errors = new ValidationErrors();
            errors.addGlobalError(new LocalizableError("doAjaxQueryCommissionCode.exception") );
            getContext().setValidationErrors(errors);
            // 回傳 錯誤 HTML fragments
            return super.errorsToHtmlStreams(errors);
        
        }
        return new ForwardResolution(AJAX_LIST_DETAILBY_GROUP);
        //return new ForwardResolution(AJAX_LIST_DETAIL); 
    }
    
	/**
	 * 
	 * 根據通路跟日期 取得  CommissionCode 明細 (可分群組)
	 * @author Jeff
	 */
	public Resolution doAjaxQueryTotalCommissionCode()
	{
		logger.debug("Enter doAjaxQueryTotalCommissionCode mehtod.");
		try {
			
		            if (null == qryDateType || 2 != qryDateType.intValue())
		                qryDateType = new Integer(1);
		            
		            if (null == this.qryPayment)
		                this.qryPayment = new Payment();

		            Group group=new Group();
		        	//如果不是銀行端，則查詢條件要加入帳單業者限制
		            if (!UserUtil.isBankGroup())
		            {
		            	group=UserUtil.getUserGroup();
		                this.qryPayment.setGroup(group);
		            }
		            else
		            {
		                if (null != this.qryPayment.getGroup())
		                    this.qryPayment.setGroup(this.groupService.findByExactGroupNo(this.qryPayment.getGroup().getGroupNo()));
		            }
		            
		            String[] channels = {
			        		channelD,channelE,channelF ,channelG, channelH};
		            
		            Date [] qryDateFroms = 
		            {
		            		qryDateFromD,qryDateFromE,qryDateFromF,qryDateFromG,qryDateFromH
		            };
		            
		            Date[] qryDateTos =
		            {
		            		qryDateToD,qryDateToE,qryDateToF,qryDateToG,qryDateToH
		            };
		            PaginatedList<Map<String,Object>> query = new PaginatedList<Map<String,Object>>();
		            
		            if (null != queryResult){
		            	query.setPageSize(queryResult.getPageSize());
		            	query.setPageNumber(queryResult.getPageNumber());
		            }
		           

				queryResult = soez5006Service.queryPaymentByChannel(group,channels, qryDateFroms, qryDateTos,query);


		}
		catch (Exception e) {
			logger.error("超商代收統計查詢錯誤(Soez5008ActionBean.doAjaxQueryTotalCommissionCode): {}",e);

			// 轉換錯誤訊息
			ValidationErrors errors = new ValidationErrors();
			errors.addGlobalError(new LocalizableError("doAjaxQueryTotalCommissionCode.exception") );
			getContext().setValidationErrors(errors);
			// 回傳 錯誤 HTML fragments
			return super.errorsToHtmlStreams(errors);

		}
		return new ForwardResolution(AJAX_LIST_DETAILBY_GROUP); 
	}

    
    
    public Resolution doDownloadDetailExcelFile()
    {
    	logger.debug("Enter doDownloadDetailExcelFile mehtod.");
        try {
       	 if (null == this.qryPayment)
	            this.qryPayment = new Payment();
       	 	Group group=new Group();
	    	//如果不是銀行端，則查詢條件要加入帳單業者限制
	        if (!UserUtil.isBankGroup())
	        {	group=UserUtil.getUserGroup();
	            this.qryPayment.setGroup(group);
	        }
	        else
	        {
	            if (null != this.qryPayment.getGroup())
	                this.qryPayment.setGroup(this.groupService.findByExactGroupNo(this.qryPayment.getGroup().getGroupNo()));
	        }
	       String downloadFilePath = soez5006Service.doAjaxQueryCommissionCodeXls(group, queryChannel, queryCommissionCode, qryDateFrom, qryDateTo);
          if (null == downloadFilePath)
          {
              // 查無資料
          }
          
          File downloadFile = new File(downloadFilePath);
          byte[] bytes = new byte[(int)downloadFile.length()];
          
          BufferedInputStream bufferedInputStream = 
              new BufferedInputStream(new FileInputStream(downloadFile)); 

          bufferedInputStream.read(bytes);

          ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);
          inputStream.close();
          bufferedInputStream.close();

          String isoFileName = new String("超商郵局代收統計明細表.xls".getBytes("MS950"), "ISO8859-1");

          StreamingResolution streamingResolution = new StreamingResolution( 
                          "application/vnd.ms-excel",inputStream).setFilename(isoFileName);

          return streamingResolution;
        }
        catch (Exception e) {
            logger.error("", e);
        }
        return new ForwardResolution(DEFAULT_JSP); 
    }
    
    
    public Resolution doDownloadGroupExcelFile()
    {
    	 logger.debug("Enter doDownloadGroupExcelFile mehtod.");
         try {
        	 if (null == this.qryPayment)
 	            this.qryPayment = new Payment();
 	    	
 	    	//如果不是銀行端，則查詢條件要加入帳單業者限制
 	        if (!UserUtil.isBankGroup())
 	        {
 	            this.qryPayment.setGroup(UserUtil.getUserGroup());
 	        }
 	        else
 	        {
 	            if (null != this.qryPayment.getGroup())
 	                this.qryPayment.setGroup(this.groupService.findByExactGroupNo(this.qryPayment.getGroup().getGroupNo()));
 	        }
 	        
 	       String downloadFilePath = soez5006Service.doExportStatisticsByGroupXls(qryPayment.getGroup(), qryDateFrom, qryDateTo);
           if (null == downloadFilePath)
           {
               // 查無資料
           }
           
           File downloadFile = new File(downloadFilePath);
           byte[] bytes = new byte[(int)downloadFile.length()];
           
           BufferedInputStream bufferedInputStream = 
               new BufferedInputStream(new FileInputStream(downloadFile)); 

           bufferedInputStream.read(bytes);

           ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);
           inputStream.close();
           bufferedInputStream.close();

           String isoFileName = new String("超商郵局代收統計表.xls".getBytes("MS950"), "ISO8859-1");

           StreamingResolution streamingResolution = new StreamingResolution( 
                           "application/vnd.ms-excel",inputStream).setFilename(isoFileName);

           return streamingResolution;
         }
         catch (Exception e) {
             logger.error("", e);
         }
         return new ForwardResolution(DEFAULT_JSP); 
    }
    
    /**
     * 下載Excel
     * @return
     */
    public Resolution doAjaxDownloadExcelFile()
    {
        logger.debug("Enter doAjaxDownloadExcelFile mehtod.");
        try {
            if (null == qryDateType || 2 != qryDateType.intValue())
                qryDateType = new Integer(1);
            
            if (null == this.qryPayment)
                this.qryPayment = new Payment();
            
            Group group=new Group();
            //如果不是銀行端，則查詢條件要加入帳單業者限制
            if (!UserUtil.isBankGroup())
            {
            	 group=UserUtil.getUserGroup();
                this.qryPayment.setGroup(group);
            }
            else
                if (null != this.qryPayment.getGroup())
                this.qryPayment.setGroup(this.groupService.findByExactGroupNo(this.qryPayment.getGroup().getGroupNo()));
            
            String[] channels = {
	        		channelD,channelE,channelF ,channelG, channelH};
            
            Date [] qryDateFroms = 
            {
            		qryDateFromD,qryDateFromE,qryDateFromF,qryDateFromG,qryDateFromH
            };
            
            Date[] qryDateTos =
            {
            		qryDateToD,qryDateToE,qryDateToF,qryDateToG,qryDateToH
            };

            
            String downloadFilePath = this.soez5006Service.doExportStatisticsXls(group,  channels , qryDateFroms, qryDateTos);
            if (null == downloadFilePath)
            {
                // 查無資料
            }
            
            File downloadFile = new File(downloadFilePath);
            byte[] bytes = new byte[(int)downloadFile.length()];
            
            BufferedInputStream bufferedInputStream = 
                new BufferedInputStream(new FileInputStream(downloadFile)); 

            bufferedInputStream.read(bytes);

            ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);
            inputStream.close();
            bufferedInputStream.close();

            String isoFileName = new String("超商郵局代收統計表.xls".getBytes("MS950"), "ISO8859-1");

            StreamingResolution streamingResolution = new StreamingResolution( 
                            "application/vnd.ms-excel",inputStream).setFilename(isoFileName);

            return streamingResolution;
        }
        catch (Exception e) {
            logger.error("", e);
        }
        return new ForwardResolution(DEFAULT_JSP); 
    }
    
    
	/**
	 * 下載畫面Excel
	 * @return
	 */
	public Resolution doAjaxDownloadTotalExcelFile()
	{
		logger.debug("Enter doAjaxDownloadTotalExcelFile mehtod.");
		try {
			 if (null == qryDateType || 2 != qryDateType.intValue())
	                qryDateType = new Integer(1);
	            
	            if (null == this.qryPayment)
	                this.qryPayment = new Payment();
	            
	            Group group=new Group();
	            //如果不是銀行端，則查詢條件要加入帳單業者限制
	            if (!UserUtil.isBankGroup())
	            {
	            	 group=UserUtil.getUserGroup();
	                this.qryPayment.setGroup(group);
	            }
	            else
	                if (null != this.qryPayment.getGroup())
	                this.qryPayment.setGroup(this.groupService.findByExactGroupNo(this.qryPayment.getGroup().getGroupNo()));
	            
	            String[] channels = {
		        		channelD,channelE,channelF ,channelG, channelH};
	            
	            Date [] qryDateFroms = 
	            {
	            		qryDateFromD,qryDateFromE,qryDateFromF,qryDateFromG,qryDateFromH
	            };
	            
	            Date[] qryDateTos =
	            {
	            		qryDateToD,qryDateToE,qryDateToF,qryDateToG,qryDateToH
	            };

			String downloadFilePath = this.soez5006Service.doExportChannelStatisticsXls(group,channels,  qryDateFroms , qryDateTos);

			if (null == downloadFilePath)
			{
				// 查無資料
			}

			File downloadFile = new File(downloadFilePath);
			byte[] bytes = new byte[(int)downloadFile.length()];

			BufferedInputStream bufferedInputStream = 
				new BufferedInputStream(new FileInputStream(downloadFile)); 

			bufferedInputStream.read(bytes);

			ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);
			inputStream.close();
			bufferedInputStream.close();

			String isoFileName = new String("超商郵局代收統計表.xls".getBytes("MS950"), "ISO8859-1");

			StreamingResolution streamingResolution = new StreamingResolution( 
					"application/vnd.ms-excel",inputStream).setFilename(isoFileName);

			return streamingResolution;
		}
		catch (Exception e) {
			logger.error("", e);
		}
		return new ForwardResolution(DEFAULT_JSP); 
	}


    
    
    
    
    
    /**
     * 帳單業者查詢
     * @return
     */
    public Resolution doAjaxQueryGroups()
    {
        logger.debug("Enter doAjaxQueryGroups mehtod.");
        try {
            //如果不是銀行端，則查詢條件要加入帳單業者限制
            if (!UserUtil.isBankGroup())
            {
                throw new Exception("No Authority");
            }
            

            //USER未輸入查詢條件，所以查詢物件會是NULL(查詢物件不可為NULL)
            if (null == qryGroup)
                qryGroup = new Group();

            //呼叫服務查詢
            queryGroupResult = groupService.queryByGroupExcludeBank(qryGroup, queryGroupResult);
        }
        catch (Exception e) {
            logger.error("帳單通路統計表-帳單業者查詢錯誤(Soez5006ActionBean.doAjaxQueryGroups):", e);

            // 轉換錯誤訊息
            ValidationErrors errors = new ValidationErrors();
            errors.addGlobalError(new SimpleError("查詢錯誤！"));
            getContext().setValidationErrors(errors);
            // 回傳 錯誤 HTML fragments
            return super.errorsToHtmlStreams(errors);
        }

        return new ForwardResolution(AJAX_QUERY_GROUP_JSP);
    }

    
    
    /**
     * @return the qryPayment
     */
    public Payment getQryPayment() {
        return qryPayment;
    }

    
    /**
     * @param qryPayment the qryPayment to set
     */
    public void setQryPayment(Payment qryPayment) {
        this.qryPayment = qryPayment;
    }

    
    /**
     * @return the queryResult
     */
    public PaginatedList<Payment> getQueryResult() {
        return queryResult;
    }

    
    /**
     * @param queryResult the queryResult to set
     */
    public void setQueryResult(PaginatedList<Payment> queryResult) {
        this.queryResult = queryResult;
    }

    
    /**
     * @return the queryGroupResult
     */
    public PaginatedList<Group> getQueryGroupResult() {
        return queryGroupResult;
    }

    
    /**
     * @param queryGroupResult the queryGroupResult to set
     */
    public void setQueryGroupResult(PaginatedList<Group> queryGroupResult) {
        this.queryGroupResult = queryGroupResult;
    }

    /**
     * @return the qryDateType
     */
    public Integer getQryDateType() {
        return qryDateType;
    }

    
    /**
     * @param qryDateType the qryDateType to set
     */
    public void setQryDateType(Integer qryDateType) {
        this.qryDateType = qryDateType;
    }

    
    /**
     * @return the qryDateFrom
     */
    public Date getQryDateFrom() {
        return qryDateFrom;
    }

    
    /**
     * @param qryDateFrom the qryDateFrom to set
     */
    public void setQryDateFrom(Date qryDateFrom) {
        this.qryDateFrom = qryDateFrom;
    }

    
    /**
     * @return the qryDateTo 
     */
    public Date getQryDateTo() {
        return qryDateTo;
    }

    
    /**
     * @param qryDateTo the qryDateTo to set
     */
    public void setQryDateTo(Date qryDateTo) {
        this.qryDateTo = qryDateTo;
    }

    
    /**
     * @return the qryGroup
     */
    public Group getQryGroup() {
        return qryGroup;
    }

    
    /**
     * @param qryGroup the qryGroup to set
     */
    public void setQryGroup(Group qryGroup) {
        this.qryGroup = qryGroup;
    }

	public List getResultByGroup() {
		return resultByGroup;
	}

	public void setResultByGroup(List resultByGroup) {
		this.resultByGroup = resultByGroup;
	}

	public String getQueryChannel() {
		return queryChannel;
	}

	public void setQueryChannel(String queryChannel) {
		this.queryChannel = queryChannel;
	}

	public String getQueryCommissionCode() {
		return queryCommissionCode;
	}

	public void setQueryCommissionCode(String queryCommissionCode) {
		this.queryCommissionCode = queryCommissionCode;
	}

	public List getResultChannelCommissions() {
		return resultChannelCommissions;
	}

	public void setResultChannelCommissions(List resultChannelCommissions) {
		this.resultChannelCommissions = resultChannelCommissions;
	}

	public Date getQryDateFromD() {
		return qryDateFromD;
	}

	public void setQryDateFromD(Date qryDateFromD) {
		this.qryDateFromD = qryDateFromD;
	}

	public Date getQryDateToD() {
		return qryDateToD;
	}

	public void setQryDateToD(Date qryDateToD) {
		this.qryDateToD = qryDateToD;
	}

	public Date getQryDateFromE() {
		return qryDateFromE;
	}

	public void setQryDateFromE(Date qryDateFromE) {
		this.qryDateFromE = qryDateFromE;
	}

	public Date getQryDateToE() {
		return qryDateToE;
	}

	public void setQryDateToE(Date qryDateToE) {
		this.qryDateToE = qryDateToE;
	}

	public Date getQryDateFromF() {
		return qryDateFromF;
	}

	public void setQryDateFromF(Date qryDateFromF) {
		this.qryDateFromF = qryDateFromF;
	}

	public Date getQryDateToF() {
		return qryDateToF;
	}

	public void setQryDateToF(Date qryDateToF) {
		this.qryDateToF = qryDateToF;
	}

	public Date getQryDateFromG() {
		return qryDateFromG;
	}

	public void setQryDateFromG(Date qryDateFromG) {
		this.qryDateFromG = qryDateFromG;
	}

	public Date getQryDateToG() {
		return qryDateToG;
	}

	public void setQryDateToG(Date qryDateToG) {
		this.qryDateToG = qryDateToG;
	}

	public Date getQryDateFromH() {
		return qryDateFromH;
	}

	public void setQryDateFromH(Date qryDateFromH) {
		this.qryDateFromH = qryDateFromH;
	}

	public Date getQryDateToH() {
		return qryDateToH;
	}

	public void setQryDateToH(Date qryDateToH) {
		this.qryDateToH = qryDateToH;
	}

	public String getChannelD() {
		return channelD;
	}

	public void setChannelD(String channelD) {
		this.channelD = channelD;
	}

	public String getChannelE() {
		return channelE;
	}

	public void setChannelE(String channelE) {
		this.channelE = channelE;
	}

	public String getChannelF() {
		return channelF;
	}

	public void setChannelF(String channelF) {
		this.channelF = channelF;
	}

	public String getChannelG() {
		return channelG;
	}

	public void setChannelG(String channelG) {
		this.channelG = channelG;
	}

	public String getChannelH() {
		return channelH;
	}

	public void setChannelH(String channelH) {
		this.channelH = channelH;
	}

	public Date getQryDateFromAll() {
		return qryDateFromAll;
	}

	public void setQryDateFromAll(Date qryDateFromAll) {
		this.qryDateFromAll = qryDateFromAll;
	}

	public Date getQryDateToAll() {
		return qryDateToAll;
	}

	public void setQryDateToAll(Date qryDateToAll) {
		this.qryDateToAll = qryDateToAll;
	}

	public String getDetailType() {
		return detailType;
	}

	public void setDetailType(String detailType) {
		this.detailType = detailType;
	}
}
